// 抓取到cart
var cart = document.getElementById("cart");
var cartStatus = 0;
// 抓取到cart_list
var cart_list = document.getElementById("cart_list");
var cartListStatus = 0;
// 当鼠标遇到cart上时候 购物车显示
cart.onmouseover = function(){
	cart_list.style.top = "40px";
}
cart.onmouseout = function(){
    setTimeout(function(){
		cart_list.style.top = "-140px";
	},1000)
}




// 小米明星产品js prev.style.color ="#E2E3E6";
var sm_father = document.getElementById("sm_father");
var pro_menu = document.getElementsByClassName("pro_menu");
var pre = document.getElementById("pre");
var next = document.getElementById("next")
tmp = 0;
run = function(){
	 tmp =  parseInt(getComputedStyle(sm_father).marginLeft);
	 if( tmp == 0 ){
	 	next.style.color = "#E0E0E0";
	 	pre.style.color = "#B3B0B0";
	 	sm_father.style.marginLeft = "-1245px";
	 }else{
	 	sm_father.style.marginLeft = "0px";
	 	pre.style.color = "#E0E0E0";
	 	next.style.color = "#B3B0B0";
	 }
}
run();
next.onclick = function(){
	run();
}


var time = setInterval(run,4000);
next.onmouseover = function(){
	clearInterval(time);
	next.style.color = "#FF6700";
}
next.onmouseout = function(){
	next.style.color = "#E0E0E0";
	time = setInterval(run,4000);
}
pre.onmouseover = function(){
	clearInterval(time);
	pre.style.color = "#FF6700";
}
pre.onmouseout = function(){
	pre.style.color = "#E0E0E0";
	time = setInterval(run,4000);
}